import { IsEmail, IsString, Length, IsInt } from 'class-validator';
import { ApiModelProperty } from '@nestjs/swagger';
// export interface User {
//   readonly id: number;
//   readonly name: string;
//   readonly age: string;
// }

export class User {
  @ApiModelProperty()
  @IsInt()
  readonly id: number;
  @ApiModelProperty()
  @IsString()
  @Length(0, 4, {
    message: '名字长度必须在$constraint1-$constraint2之间'
  })
  readonly name: string;
  @ApiModelProperty()
  @IsInt({
    message: '$property年龄必须是数字类型格式!!!'
  })
  readonly age: string;
  
  readonly grade?: string;
}